﻿using Acme.ConcreteMixDesign.Dtos;
using Acme.ConcreteMixDesign.JobRecords;
using Acme.ConcreteMixDesign.Players;
using Acme.ConcreteMixDesign.Top_Info;
using Acme.ConcreteMixDesign.TopicInformations;
using Acme.ConcreteMixDesign.Topics;
using AutoMapper;
using Volo.Abp.AutoMapper;

namespace Acme.ConcreteMixDesign;

public class ConcreteMixDesignApplicationAutoMapperProfile : Profile
{
    public ConcreteMixDesignApplicationAutoMapperProfile()
    {
        /* You can configure your AutoMapper mapping configuration here.
         * Alternatively, you can split your mapping configurations
         * into multiple profile classes for a better organization. */

        CreateMap<Player, PlayerDto>();
        CreateMap<CreatePlayerDto, Player>()
            .Ignore(a=>a.Id);

        CreateMap<Topic, TopicDto>();
        CreateMap<CreateTopicDto, Topic>();

        CreateMap<JobRecord, JobRecordDto>();
        CreateMap<CreateJobRecordDto, JobRecord>();

        CreateMap<Answer, AnswerDto>();
        CreateMap<AnswerDto, Answer>();

        CreateMap<CreateAnswerDto, AnswerDto>();
        CreateMap<AnswerDto, CreateAnswerDto>();


        CreateMap<CreateAnswerDto, Answer>()
        .ForMember(dest => dest.TopicId, opt => opt.MapFrom(src => src.TopicId));

        CreateMap<TopicInformation, TopicInformationDto>();
        CreateMap<TopicInformationDto, TopicInformation>();
        CreateMap<CreateInformationDto, TopicInformation>();

        CreateMap<UpdateTopicDto, Topic>();
        CreateMap<Topic, UpdateTopicDto>();

        CreateMap<CreateTopicToInforDto, TopicAndInfor>();
        CreateMap<TopicAndInfor, CreateTopicToInforDto > ();

        CreateMap<TopicAndInfor, TopicAndInforDto>();
        CreateMap<TopicAndInforDto, TopicAndInfor > ();
    }
}
